package ama.dao;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.sun.appserv.jdbc.DataSource;

public class ConnexionJavaDB {
	
	private static DataSource datasource;
	
	public static DataSource getInstance(){
		
		if(datasource == null){
			try{
				Context initCtx = new InitialContext();
				datasource = (DataSource) initCtx.lookup("java:comp/env/jdbc/Demo");
			}catch(NamingException e){
				System.out.println("datasources pbm");
			}
		}
		return datasource;
	}

}
